<?php
/**
 *
 * redis Key Cache
 *
 * RedisKeyCache.class.php
 * Created by IntelliJ IDEA.
 *
 * @author: hjh <hjh@jf.com>
 *
 * Date: 2017/9/27
 * Time: 11:45
 */

namespace Tools;

use Common\Bridge;
use Constants\RedisDBConstant;

class RedisKeyCache
{
    public static function getReviewVersion()
    {
        return Bridge::redis(Bridge::REDIS_USER_R, RedisDBConstant::DB_REVIEW_VERSION)->get(RedisDBConstant::DB_REVIEW_VERSION_KEY);
    }

    public static function setReviewVersion($version)
    {
        return Bridge::redis(Bridge::REDIS_USER_W, RedisDBConstant::DB_REVIEW_VERSION)->set(RedisDBConstant::DB_REVIEW_VERSION_KEY, $version);
    }

    public static function getLoginByCode(){
        return Bridge::redis(Bridge::REDIS_USER_R, RedisDBConstant::DB_REVIEW_VERSION)->get(RedisDBConstant::DB_LOGIN_BY_CODE_KEY);
    }

    public static function setLoginByCode($code){
        return Bridge::redis(Bridge::REDIS_USER_W, RedisDBConstant::DB_REVIEW_VERSION)->set(RedisDBConstant::DB_LOGIN_BY_CODE_KEY, $code);
    }
}
